package com.movie.demo.controller;

import com.movie.demo.Utlis.result.CommonResult;
import com.movie.demo.pojo.Session;
import com.movie.demo.service.SessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class SessionController {

    @Autowired
    private SessionService sessionService;

    @PostMapping("/selectSession")
    public CommonResult<List> selectSession(){
        List<Session> sessionList=sessionService.selectSession();
        return CommonResult.success(sessionList);
    }
}
